var Dog = require('./dog.js');
var dog = new Dog('taidy');
//dog对象具有EventEmitter的属性方法
dog.on('bark',() => {
    console.log(this);
    dog.bark();//此时箭头函数指向空对象
})

setTimeout(()=>{
    dog.emit('bark');
},3000)